#This file holds a weights class. These weights are to be used for oversampling in NaiveBayes.
#Each weight indicates how many time each post of a given class should be counted.

import Post

class Weights:
	#Constructor
	def __init__(self, open, offTopic, notConstructive, notARealQuestion, tooLocalized):
		self.open = open
		self.offTopic = offTopic
		self.notConstructive = notConstructive
		self.notARealQuestion = notARealQuestion
		self.tooLocalized = tooLocalized
	
	#Gets the weight value corresponding to the given post status
	def getWeightByStatus(self, postStatus):
		if(postStatus == Post.PostStatusEnum.OPEN):
			return self.open
		if(postStatus == Post.PostStatusEnum.OFF_TOPIC):
			return self.offTopic
		if(postStatus == Post.PostStatusEnum.NOT_CONSTRUCTIVE):
			return self.notConstructive
		if(postStatus == Post.PostStatusEnum.NOT_A_REAL_QUESTION):
			return self.notARealQuestion
		if(postStatus == Post.PostStatusEnum.TOO_LOCALIZED):
			return self.tooLocalized
		sys.exit("error should not reach here")